import request from "@/utils/request"
import {qsStringify} from "@/utils/common"

// 使用枚举包含所有path
enum Api {
	// 读取状态数据
	dpdReadStatus = "/exc/dpdReadStatus",
	// 读取测量模式
	dpdReadMode = "/exc/dpdReadMode",
	// 设置数据
	setDpdData = "/exc/dpdSetData"
}

// 读取状态数据的Api
export const dpdReadStatusApi = (data: {devGId: string | null}) => {
	let dataQ = "?" + qsStringify(data)
	return request.post(Api.dpdReadStatus + dataQ)
}

// 读取测量模式的Api
export const dpdReadModeApi = (data: {devGId: string | null}) => {
	let dataQ = "?" + qsStringify(data)
	return request.post(Api.dpdReadMode + dataQ)
}

// 设置数据的Api
export const setDpdDataApi = (data: {
	devGId: string | null
	typeId: string | number | null
	value: any
}) => {
	let dataQ = "?" + qsStringify(data)
	return request.post(Api.setDpdData + dataQ)
}
